package com.zhou.provider.service.impl.user;

import com.zhou.common.domain.User;
import com.zhou.provider.dao.UserDao;
import com.zhou.provider.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @author zkb
 */

@Service
public class UserServiceImpl implements UserService {

    private static final String CACHE_KEY = "'user'";
    private static final String CACHE_NAME_B = "cache-b";

    @Autowired
    private UserDao userDao;

    @Override
    @Cacheable(value=CACHE_NAME_B, key="'user_'+#id")
    public User findUserById(Long id) {
        return userDao.findUserById(id);
    }

    @Override
    public List<User> findAllUsers() {
        return null;
    }

    @Override
    public int insertUser(User user) {
        return 0;
    }

    @Override
    public int updateUser(User user) {
        return 0;
    }

    @Override
    public int deleteUser(Long id) {
        return 0;
    }
}
